<meta charset="utf-8">

<div>
  <h3>我的病人</h3>
  <form class="form-inline">
    <div class="input-group">
      <input class="input-control" ng-model="query" placeholder="请输入搜索内容" type="text">
      <label class="radio">
        <input ng-model="query" type="radio" value="进入治疗"/>正在治疗({{vm.in}})</label>
      <label class="radio">
        <input ng-model="query" type="radio" value="结束治疗"/>结束治疗({{vm.out}})</label>
      <label class="radio">
        <input ng-model="query" type="radio" value="男"/>男</label>
      <label class="radio">
        <input ng-model="query" type="radio" value="女"/>女</label>
    </div>
  </form>

  <table class="table table-hover table-condensed content-table">
    <thead>
      <tr>
        <th></th>
        <th ng-click="psort('patientid')">病例号</th>
        <th ng-click="psort('patientname')">病人姓名</th>
        <th ng-click="psort('patientbithday')">出生日期</th>
        <th ng-click="psort('clinicalcondition')">临床症状</th>
        <th></th>
      </tr>
    </thead>
    <tbody>
      <tr ng-repeat="patient in vm.patients | filter:query | paging:vm.page.index:vm.page.size | orderBy:order">
        <td class="list-section">
            <img class="img-circle img-display" ng-if="patient.coverphoto!=null" ng-src="images{{patient.coverphoto}}"  alt=""/>
            <img class="img-circle img-display" ng-if="patient.coverphoto==null" ng-src="img/0.jpg"  alt=""/>
        </td>
        <td>
          <a ng-href="#/view/{{patient.patientid}}">{{patient.patientid}}</a>
        </td>
        <td><span>{{patient.patientname}}</span></td>
        <td>{{patient.patientbithday}}</td>
        <td>{{patient.clinicalcondition}}</td>
        <td>
          <button class="btn btn-danger" ng-click="open(patient)">
            <span class="glyphicon glyphicon-trash">删除</span>
          </button>
        </td>

      </tr>
    </tbody>
  </table>

  <pagination boundary-links="true" class="pagination-sm pull-right" first-text="首页" items-per-page="vm.page.size" last-text="末页" max-size="5" next-text="下一页" ng-model="vm.page.index" previous-text="上一页" total-items="patients|filter:query|size"></pagination>
</div>


<script type="text/ng-template" id="Alert.html">
        <div class="modal-header">
            <h4 class="modal-title">确定删除病人以及相关图像吗？</h4>
        </div>
        <div class="modal-footer">
          <button class="btn btn-danger" ng-click="remove()">删除</button>
          <button class="btn btn-primary" ng-click="cancel()">取消</button>
        </div>
</script>
